home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / source / xdme_1.84_src.lha / XDME / Src / Var / SigHandler.tplt < prev    next >
Encoding:
Text File  |  1994-11-06  |  1.4 KB  |  100 lines

  1.  
  2.  
  3. void SignalHandler (void)
  4. {
  5.     ULONG signal;
  6.  
  7.     for (;;)
  8.     {
  9.     signal = Wait ( $(@FOREACH@sighandler@$(@LOCK@sighandler@ $(sigmask)| ))0 );
  10.     clearbreaks();
  11.  
  12. $(@FOREACH@sighandler@$(@LOCK@sighandler@
  13.     if (signal & $(sigmask))
  14.     {
  15.         text_cursor (0);
  16.         show_cursor ++;
  17.  
  18. $(code)
  19.  
  20.         signal &= ~$(sigmask);
  21.     } /* if */))
  22.     } /* forever */
  23. termination:
  24. } /* SignalHandler */
  25.  
  26.  
  27. #ifdef SPC_PRE
  28.  
  29. sighandler idcmpdispatcher = {
  30.  
  31.     signal = "IDCMP_Mask";
  32.  
  33.     code = %[
  34.     {
  35.         IMESS * im;
  36.         IMESS   imc;
  37.  
  38.         while (im = (IMESS *)GetMsg(Ep->win->UserPort))
  39.         {
  40.         SETF_ABORTCOMMAND(Ep,0);
  41.         SETF_MSGCHECK(Ep,1);
  42.         clearbreaks ();
  43.  
  44.         Code         = im->Code;
  45.         Qualifier    = im->Qualifier;
  46.  
  47.  
  48.         if (im->IDCMPWindow != Ep->win)
  49.         {
  50.             SETF_OVERIDE(Ep,0);
  51.  
  52.             if (GETF_COMLINEMODE(Ep))
  53.             escapecomlinemode ();
  54.  
  55.             text_sync ();
  56.  
  57.             MShowTitle = 0;
  58.  
  59.             if (!GETF_ICONMODE(Ep))
  60.             window_title ();
  61.  
  62.             if (text_switch (im->IDCMPWindow) == 0)
  63.             {
  64.             ReplyMsg ((MSG *)im);
  65.             continue;
  66.             }
  67.         }
  68.  
  69.         Mx = im->MouseX;
  70.         My = im->MouseY;
  71.  
  72.         imc = *im;
  73.         ReplyMsg (im);
  74.         im = NULL;
  75.  
  76.         switch(im->Class)
  77.         {
  78. $(@FOREACH@idcmphandler@$(@LOCK@idcmphandler@
  79.         case $(class):
  80. $(code)
  81.         break; /* $(class) */
  82. ))
  83.         } /* switch (class) */
  84.  
  85.         if (im)
  86.             ReplyMsg ((MSG *)im);
  87.  
  88.         if (GETF_QUITFLAG(Ep))
  89.         {
  90.             dontwait = 2;
  91.             goto boom;
  92.         } /* if (Quitflag) */
  93.         } /* While IntuiMessage */
  94.     }
  95.     %];
  96. };
  97.  
  98. #endif
  99.  
  100.